import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import vantuis from './plugins/vantUi'
// 引入amfe-flexible适配处理文件
import 'amfe-flexible';
// 引入初始化css
import './assets/style/init.css'
import FastClick from 'fastclick'
FastClick.attach(document.body);

const app = createApp(App)

app.config.globalProperties.$filters = {
    photo(value) {
        switch (value) {
            case 1:
              return  require('./assets/avatar/1.png') 
            case 2:
              return require('./assets/avatar/2.png') 
            case 3:
              return require('./assets/avatar/3.png') 
            case 4:
              return require('./assets/avatar/4.png') 
            case 5:
              return require('./assets/avatar/5.png') 
            case 6:
              return require('./assets/avatar/6.png') 
            case 7:
              return require('./assets/avatar/7.png') 
            case 8:
              return require('./assets/avatar/8.png') 
            case 9:
              return require('./assets/avatar/9.png') 
            case 10:
              return require('./assets/avatar/10.png') 
            case 11:
              return require('./assets/avatar/11.png') 
            case 12:
              return require('./assets/avatar/12.png') 
            default:
              return require('./assets/avatar/1.png') 
          }
    },
    photo_min(value) {
      switch (value) {
          case 1:
            return  require('./assets/avatar_min/1.png') 
          case 2:
            return require('./assets/avatar_min/2.png') 
          case 3:
            return require('./assets/avatar_min/3.png') 
          case 4:
            return require('./assets/avatar_min/4.png') 
          case 5:
            return require('./assets/avatar_min/5.png') 
          case 6:
            return require('./assets/avatar_min/6.png') 
          case 7:
            return require('./assets/avatar_min/7.png') 
          case 8:
            return require('./assets/avatar_min/8.png') 
          case 9:
            return require('./assets/avatar_min/9.png') 
          case 10:
            return require('./assets/avatar_min/10.png') 
          case 11:
            return require('./assets/avatar_min/11.png') 
          case 12:
            return require('./assets/avatar_min/12.png') 
          default:
            return require('./assets/avatar_min/1.png') 
        }
  },
    getmoney(value){
        if(value==undefined){
            return 0
          }else{
            return   String(value/100).replace(/^(.*\..{2}).*$/ ,"$1")
          }
    }
  }

import {getUUIDS,randomString} from "@uit/common"
 
try{
  if(!localStorage.getItem('device-id')){
    localStorage.setItem('device-id', getUUIDS('https://www.google.com/')+'-'+Date.now()+'-'+randomString(6));
  }
  
}catch(err){
    throw err
}


import { VueClipboard } from '@soerenmartius/vue3-clipboard'

app.use(store)
   .use(router)
   .use(vantuis)
   .use(VueClipboard)
   .mount('#app')
